﻿<%@ WebHandler Language="C#" Class="getCity" %>

using System;
using System.Web;
using System.Collections.Generic;
public class getCity : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/html";
        string id = context.Request.QueryString["id"];
        if (id == null) return;
        MatchIns.BLL.PageInfo pi = new MatchIns.BLL.PageInfo(int.MaxValue, 1);
        pi.Where = " where provinceid='" + id+"'";
        List<MatchIns.Model.TB_City> citys = new MatchIns.BLL.TB_City().GetPageList(pi).List;
        context.Response.Write("<option value='0'>选择城市</option>");
        foreach (MatchIns.Model.TB_City city in citys)
        {
            context.Response.Write("<option value='"+city.CityID+"'>");
            context.Response.Write(city.CityName);
            context.Response.Write("</option>");
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}